﻿using IntelligentAgriculture.Contracts.Interface;
using IntelligentAgriculture.Domain.Entity;
using IntelligentAgriculture.Services;
using IntelligentAgriculture.WebAPI.Application.Command.DeathModelCommand;
using IntelligentAgriculture.WebAPI.Application.Command.SheepAblactationCommand;
using MediatR;

namespace IntelligentAgriculture.WebAPI.Application.CommandHandler.DeathModelCommandJamdier
{
    public class DeathEagCommandHandler : IRequestHandler<DeathEagCommand, Results<List<Eartag>>>
    {
        private readonly iDeathModelService _iDeathModelService;

        public DeathEagCommandHandler(iDeathModelService deathModelService)
        {
            _iDeathModelService = deathModelService;
        }

        public async Task<Results<List<Eartag>>> Handle(DeathEagCommand request, CancellationToken cancellationToken)
        {
            return Results<List<Eartag>>.DataResult(await _iDeathModelService.GetEarShowinfo());
        }
    }
}
